const TransformPages = require('uni-read-pages')
const {webpack} = new TransformPages()

module.exports = {
  devServer: {
    proxy: {
      '/api': {
        target: 'https://fmapi-test.bgzyedu.com',
      },
	  // '/': {
	  //   target: 'https://fmxp-test.bgzyedu.com',
	  // },
	  
    },
  },
  configureWebpack: {
    plugins: [
      new webpack.DefinePlugin({
        ROUTES: webpack.DefinePlugin.runtimeValue(() => {
          const tfPages = new TransformPages({
            includes: ['path', 'name', 'meta','aliasPath']
          });
          return JSON.stringify(tfPages.routes)
        }, true )
      })
    ]
  }
}
